import { defineConfig } from "vitepress";

import {
  containerPreview,
  componentPreview,
} from "@vitepress-demo-preview/plugin";

// https://vitepress.dev/reference/site-config
export default defineConfig({
  title: "arco design uni",
  description: "A VitePress Site",
  vite: {
    server: {
      port: 8080, //端口号
    },
  },
  themeConfig: {
    // https://vitepress.dev/reference/default-theme-config
    nav: [
      {
        text: "指南",
        activeMatch: "/guide/",
        items: [
          {
            text: "介绍",
            link: "/guide/introduction",
          },
          {
            text: "快速上手",
            link: "/guide/quick-use",
          },
          {
            text: "定制主题",
            link: "/guide/custom-theme",
          },
          {
            text: "常见问题",
            link: "/guide/common-problems",
          },
          {
            text: "国际化",
            link: "/guide/locale",
          },
          {
            text: "更新日志",
            link: "/guide/changelog",
          },
          {
            text: "加群沟通",
            link: "/guide/join-group",
          },
        ],
      },
      {
        text: "组件",
        activeMatch: "/component/",
        items: [
          {
            text: "基础组件",
            link: "/component/button",
          },
          {
            text: "导航组件",
            link: "/component/pagination",
          },
          {
            text: "数据输入",
            link: "/component/calendar",
          },
          {
            text: "反馈组件",
            link: "/component/action-sheet",
          },
          {
            text: "数据展示",
            link: "/component/badge",
          },
        ],
      },
    ],

    sidebar: [
      {
        text: "Examples",
        items: [
          { text: "Markdown Examples", link: "/markdown-examples" },
          { text: "Runtime API Examples", link: "/api-examples" },
        ],
      },
    ],

    socialLinks: [
      { icon: "github", link: "https://gitee.com/zhou-yankai/arco-uni" },
    ],
  },
  markdown: {
    // @vitepress-demo-preview的配置
    config(md) {
      // 支持区块内的方式展示 demo 和示例代码
      md.use(containerPreview);
      md.use(componentPreview);
    },
  },
});
